import xml.dom.minidom
import wxpyview.ui.core.common.manifest
from wxpyview.ui.core.dataprovider.BaseDataProvider import *

class ExternalDataProvider(BaseDataProvider):
    def __init__(self, dom):
        BaseDataProvider.__init__(self)
        
        data_path = dom.getAttribute("dataProvider")
        dom_tree = xml.dom.minidom.parse(data_path)
        dom_head = dom_tree.getElementsByTagNameNS(
                    wxpyview.ui.core.common.manifest.WXPYVIEW_NS, "dataProvider")[0]
        
        self._parseProviderDom(dom_head)